package com.by.erpcu.controller;

import com.by.bean.BeanResult;
import com.by.erpcu.entity.Customer;
import com.by.erpcu.service.CustomerService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (Customer)表控制层
 *
 * @author makejava
 * @since 2025-02-15 11:04:27
 */
@RestController
@RequestMapping("api/customer")
@Api(tags = "客户管理")
@Slf4j
public class CustomerController {
    @Autowired
    private CustomerService customerService;

    @GetMapping("/{id}")
    @ApiOperation(value = "根据id查询客户信息")
    public BeanResult<Customer> getCustomerById(String id) {
        Customer customer = customerService.getCustomerById(id);
        log.info("查询客户信息：{}", customer);
        return BeanResult.success(customer);
    }

}

